﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfFileUpload.aspx.cs" Inherits="msBsc.WebUi.wfFileUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品属性模版</title>
    <style type="text/css">
        html, body { overflow: hidden; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; }
        .aBtn_yellow {
	        padding: 4px 7px;padding: 6px 12px;color: rgb(51, 102, 204); border-radius: 2px; width: auto; height: 14px; color: rgb(255, 255, 255); line-height: 14px; text-decoration: none;  display: block; cursor: pointer; background-color: rgb(255, 153, 0); -webkit-border-radius: 2px; -moz-border-radius: 2px;
        }
        .aBtn_blue {
	        padding: 4px 7px;padding: 6px 12px;color: rgb(51, 102, 204); border-radius: 2px; width: auto; height: 14px; color: rgb(255, 255, 255); line-height: 14px; text-decoration: none;  display: block; cursor: pointer; background-color: rgb(0, 129, 204); -webkit-border-radius: 2px; -moz-border-radius: 2px;
        }
        .aBtn_grey {
	        padding: 4px 7px;padding: 6px 12px;color: rgb(51, 102, 204); border-radius: 2px; border: 1px solid rgb(221, 221, 221); width: auto; height: 14px; color: rgb(102, 102, 102); line-height: 14px; text-decoration: none; display: block; cursor: pointer; background-color: rgb(250, 250, 250); -webkit-border-radius: 2px; -moz-border-radius: 2px;
        } 
        .aBtnFloat{float: left;margin-left: 8px;}
        .cat_table {
	        padding: 10px 0px; color: rgb(61, 61, 61);
        } 
    </style>
		<script type="text/javascript" src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="/jqPlugin/js/ajaxfileupload.js"></script>
    <script type="text/javascript">
        $(window).load(function () {

            $("#file1").change(function () {
                $('#sFileNme').html(this.value);
//                document.form1.path.value = this.value;
                previewImage(this);
            });
        }); 
        function previewImage(file) {
            var porImg = $('#biuuu');
            if (file["files"] && file["files"][0]) {
                var reader = new FileReader();
                reader.onload = function (evt) {
                    porImg.attr({ src: evt.target.result });
                }
                reader.readAsDataURL(file.files[0]);
            }
            else {
                var proIeImageDom = document.createElement("div");
                $(proIeImageDom).attr({ "id": "biuuu" });
                porImg.parent().prepend(proIeImageDom);
                porImg.remove();
                file.select();
                path = document.selection.createRange().text;
                $(proIeImageDom).css({ "filter": "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='scale',src=\"" + path + "\")" });

            }
        };

        function upImg() {
            doUpload("file1", {T1:'TT1',T2:'TT2'}, function () {
            });
        };


//        function btnDo(sEbtn) {
//            GtGrid1Action = sEbtn;
//            var opart = GetGtParam("myGrid1");
//            if (sEbtn == "btnSave") {
//                doSaveGt('myGrid1');
//            }
//            else {
//                ajaxComm(opart); //调用页面回调，并传入参数
//            }
//            GtGrid1Action = "";
//        };
//        function GetGtParam(jqGridID) {
//            var _jsParam = new jsonRow();
//            if (jqGridID == "myGrid1") {
//                GetFormJson("divCondition", _jsParam);
//                _jsParam.AddCell("gtGridID", "myGrid1");
//                _jsParam.AddCell("REL_ID", $("#txtOneId").val());
//                _jsParam.AddCell("ACTION", GtGrid1Action);
//                //这里可增加传入后台的参数
//            } return _jsParam;
//        };
    </script>
</head>
<body>
    
    <div style=" padding:5px 5px 5px 15px; position:absolute; top:0px; height:30px;">
    <input type="file" id="file1" name="file1"  style="width:70px; margin-right:60px;" />  <input type="button" id="file2" name="file2" onclick="upImg();"  style="" value="确认上传图片" />
    </div>
    <div id="imglist" style=" padding:5px; margin-top:30px;">
    
        <div style="float:left;background-color: #ddd; margin:5px;">
            <div > 
                <img id="biuuu"  src="#" style=" margin:5px 5px 0px 5px; width:300px; height:250px; background-color:White;"/>
            </div>
            <div  style="  vertical-align:middle; padding-bottom:5px; width:280px;">
                <span id="sFileNme" style=" margin-left:5px;"></span>
            </div>
        </div>
    </div>
               






<div id="img_item_template" style="display:none;">


</div>
    <input value="" type="hidden" id="txtOneId"  name="txtOneId"/>
        
</body>
</html>
